home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TP051092.ARJ
/
05-10-92.TPC
Wrap
Text File
|
1992-05-10
|
114KB
|
3,548 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 01-01-00 00:00:00
From
To
Subject
--- WM v2.01/92-0100
* Origin: A.C.E. of Spades (615)383-4381 The B.A.N. board (1:116/33)
* Tossed by SFToss v1.00b on 92/04/09 12:01:00
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 12:35:46
From Trevor Carlsen
To Matt Heck
Subject Borland, OS/2 2.0, and you
MH> Is there any point to a 286 with 640k and a 40MB HDD running OS/2?
None at all, mainly because it will not run on a 286. OS/2 2.0 is a 32 bit
system specifically coded for 386/486 operation.
MH> And either way, are the rest of you planning to program for it,
MH> thereby attempting to force us to shell out more cash?
I'll wait and see. However when TP is released for OS/2 then I will definitely
buy it for a look. If the demand is there, then there is no decision required.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/02 15:11:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 12:45:29
From Trevor Carlsen
To John Gohde
Subject A Virtuous Pascal ...
JG> POINT ONE: TP4 has more than enough features to keep a first time
JG> non-genius casual programmer busy for one year of devoted study.
Agree 100%. Well put.
JG> POINT TWO: There is a market for a simple and stable real world
JG> version of Pascal...
Agree 100% - again!
JG> POINT THREE: Why pay for features and learn features that will be
JG> out of date by the time you get around to using them for the
JG> first time?
JG> In other words, why pay for TV version 6 if you wont use TV until
JG> version 7 or 8 exists?
Three in a row!
JG> POINT FOUR: There is a market segment who would buy TP4 at USA$40
JG> rather than TP6 at USA$110, if they had that option. And, this
JG> alleged FACT has nothing whatsoever to do with Borland TP
JG> propaganda.
You been reading my mind?
JG> POINT FIVE: The availability of a good, simple, and stable Pascal
JG> at USA$40 would ONLY tend to promote the use of PASCAL as a
JG> programming language; whereas the current marketing practises of
JG> Borland MAY not have the promotion of Pascal as a programming
JG> language as a priority.
I hate to say this - but that's five.
You have just determined that there is a niche market that would almost certainl
be quite lucrative... Go for it.
(See? when you stick to facts and objectivity you and I CAN agree :-) )
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/02 15:11:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 17:21:47
From Trevor Carlsen
To Lee Cassar
Subject Need some help
LC> I need some help. I want to know how to turn on and off the locks on
LC> the keyboard(scroll, num, and caps) using a turbo pascal routine.
LC> Does anyone have any ideas?
LC> (I have turbo Pascal 6.0 Professional)
type
shiftstatus = set of (RightShift, LeftShift, Ctrl, Alt,
ScrollLock, NumLock, CapsLock, InsertOn);
var
KbdStatus : shiftstatus absolute $40:$17;
Eg. To turn caps lock on -
KbdStatus := KbdStatus + [CapsLock];
To turn it off -
KbdStatus := KbdStatus - [CapsLock];
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/02 15:11:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 17:32:39
From Trevor Carlsen
To Greg Belanger
Subject Encryption of sorts..
GB> I'm lookin for a way to Encrypt various aspects of my programs. For
GB> example, I know it's quite easy to use a HEX editor and go in and edit
GB> the program name, autor and copyright info. Is there a way to make
GB> this "text" unmodifiable? I'm looking for a nice, simple routine..not
GB> 400 lines of encryption code. Any suggestions?
By far the easiest and safest way of doing what you want is to place all textual
information used by your program in a file and encrypt that file. Unencrypt
it during the initialisation routine.
Doing it this way will also solve the problem that arises when self modifying
files are used with things like foreign languages, overlays, PkLite etc.
Special foreign language editions are simply made just by providing a specific
file for that language.
To create the file just create a typed file of string[80] and use record zero
as a header in which you can store data such as random number generator seeds,
passwords etc. All this is very simple to do. Here is a simple program to
encrypt such a file and the function to place in the program to unencrypt
the respective string. It is by no means unbreakable but will certainly represe
t more trouble to work out what you are doing than it is worth!
{$X+}
program encrypt;
uses crt;
var f : file of string[80];
txt : text;
st : sting[80];
key : longint;
SavedKey : longint absolute st;
procedure EncryptStr(var st: string[80]);
var x : byte;
begin
for x := 1 to length(st) do
st[x] := char(st[x] xor random(256);
end;
begin
Randomize;
assign(f,'TheFile.cfg');
rewrite(f);
assign(txt,'RawText.txt');
reset(f);
writeln('Press any key to continue...');
repeat
key := key xor Random(MaxInt) * Random(MaxInt);
until Keypressed;
SavedKey := key;
RandSeed := key;
write(f,st);
repeat
ReadLn(txt,st);
EncryptStr(st);
write(f,st);
until eof(txt);
close(f);
close(txt);
end.
Untested.
To unencrypt just read the first 4 bytes of the first record into a longint,
use that longint as your RandomSeed and then use the above Encrypt procedure
to unencrypt the string.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/02 15:11:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 16:30:58
From Mark Ouellet
To Mike Wilson
Subject Re: DirectVideo:=? and DV
On 22 Apr 92, you, Mike Wilson, of 1:130/28.0 wrote...
MW> I have some code that I run under DV and have noticed a small problem.
MW> If I have the mouse loaded (MicorSoft Mouse) and have 2 windows open
MW> (one running the metioned software) the video in the "other" window I am
MW> in when I press "Alt" acts funny. By this I mean it acts as if the
MW> mouse is connected to the output of the "Other" window... In other words
MW> it follows the text from the other window. Now this happens with
MW> "DirectVideo := False", but when I run without this I get bleed
MW> throughs...
MW>
MW> Any suggestions?
Mike,
If you are running on a 386 then DV-386 would solve
the problem. With the ability the 386s have of remaping any
memory region, DV uses that ability to remap the video
memory used by the program when you tell it that this
particular program writes directly to video memory.
If you are specifically writing stuff for DV it also
removes the problem of getting your video buffer adress from
DV as long as you limit your programs to 386s and up.
Anything else will have to be well behaved but if you only
program for your own use then why bother if DV-386 can
handle it.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 16:41:49
From Mark Ouellet
To Dj Murdoch
Subject Re: Question, Compression
On 23 Apr 92, you, Dj Murdoch, of 1:221/177.40 wrote...
EG>> I heard about someone working on an INTENSIVE form of
EG>> compression, It would take almost a MEG and make it 1
EG>> byte, does ANY one know about this radical compression
EG>> theory?
GW>> Hehehe... sounds like "lossey" compression to me!
DM> Here's my new, super-duper lossless compression method that can compress
DM> huge files incredibly: for example, the file TURBO.EXE (325982 bytes)
DM> and the file TURBO.HLP (669951 bytes) can each be compressed into a
DM> single *bit*!!!!!!
DM>
DM> (DOS doesn't handle 1 bit files well, so I write out the bit as a whole
DM> byte. In fact, DOS will waste a whole cluster storing the compressed
DM> version, but that's not my fault.)
DM>
DM> Program Compress;
DM> begin
DM> if paramstr(1) = 'TURBO.EXE' then
DM> write('0')
DM> else
DM> write('1');
DM> end.
DM>
DM> Unfortunately, the uncompress program is rather complicated; the best
DM> I've been able to do so far is a 1 megabyte uncompressor, which looks
DM> something like this:
DM>
DM> Program UnCompress;
DM> var
DM> bit : char;
DM> begin
DM> read(bit);
DM> if bit = '0' then
DM> write_out_a_copy_of_turbo_exe
DM> else
DM> write_out_a_copy_of_turbo_hlp;
DM> end.
DM>
DM> I've left out the write_out_... routines, because they're rather dull.
DM> One limitation of this compressor: it's only lossless on TURBO.EXE and
DM> TURBO.HLP; other files are lost completely.
DM>
DM> :-) :-) :-) <======= For TeeCee :-)
Dj,
I love it but could you make me a self extracting
version ;-)
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 16:44:19
From Mark Ouellet
To KEVIN PARADINE
Subject Re: Multiuser databases
On 22 Apr 92, you, KEVIN PARADINE, of 1:107/480.0 wrote...
KP> You're better off locking the whole database, rather than a record.
KP> Why?
KP>
KP> Ok, let's say I have two files open: one is a set of message headers and
KP> the other is a set of blocks of text (for argument's sake). Instance 1
KP> of my application is just attempting to edit message 2 in the header
KP> file, and is currently reading and locking text blocks. Instance 2 of
KP> my application is deleting message 2. Instance 2 has a text block from
KP> message 2 locked currently, and is marking it as deleted. However, it
KP> will not release the lock until it can mark the header as deleted. The
KP> header is locked by instance 1. Instance 1 is trying to lock the text
KP> block that instance 2 has locked. Share wars. These two applications
KP> are LOCKED (CTRL-ALT-DEL type) unless you can abort them.
KEVIN,
Sorry but I disagree, we are using multiple
relations on an application at the office and our first rule
is if you can't lock records in every file pertaining to the
current operation [IE: if deleting a record we lock all
related records in every other database before going on]
then we simply abort the operation or suspend it until ALL
records can be securely worked on.
It's simple logic, you can't just modify the header
file and then try to move on to the message-text file, you
need to secure every related bits of that single message,
header and all.
Anyone doing it any other way is asking for trouble
and I sure wouldn't want him on my team. We got 10,000+
records containing data for that many legal actions
currently engaged either in court or under investigation in
over 30 governement agencies. One screw-up would be
disastrous and mean possibly thousands of dollars in loss for
the Departement.
We put every safety precaution into our system, in
fact it is so safe it was firstly meant as a DEMO of what
the new main-frame system should look like but the
Treasure-Board decided to keep our system. The main-frame
people had been sitting on the project for over 3 years
without a single line of code written, we got our DEMO
version out in 6 months and have been enhansing it ever
since.
Our next step is networking it and what you
described was something we wanted to avoid at all costs.
That's why we either secure our environement before doing
anything else or don't do anything.
We thought of batch processing transactions during
the night to avoid conflicts but that was one of the
draw-backs of the main-frame environement. Records have to
be updated on the fly and the new data available
immediatetly to all stations.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 17:06:50
From Mark Ouellet
To Michael Thomsen
Subject Re: testing records for equality
On 20 Apr 92, you, Michael Thomsen, of 2:201/111.0 wrote...
MT> Sorry to interrupt this conversation, But maybe this could help !
MT> Type
MT> MyRec = Record
MT> Case Byte Of
MT> 1 :(
MT> Check : LongInt;
MT> Field1 : String[80];
MT> Field2 : Array[1..15] Of Byte;
MT> );
MT> 2 :(
MT> Total : Array[1..100] Of Char;
MT> );
MT> End;
MT> (* Total have to be same size as the total RecLength, and it have to be
MT> Declaired as a Array of Char (Don't ask me why !!) *)
MT> Var
MT> Re1,
MT> Re2 : MyRec;
MT> Begin
MT> If Re1.Total = Re2.Total Then
MT> Write(^G);
MT> End.
MT> Greetings Michael Thomsen (STOCKHOLM, SWEDEN)
Michael,
it can't work, try this:
1: declare 2 instances of the record
2: Write 2 70 caracter long strings to both records,
a different one for each record.
3: Now write 'SHOULD BE EQUAL' to both records.
4: Compare both records and they won't compare
Want to know why:
Take two equal size cups, fill one with Salt water,
fill the other with Sugar saturated water. Now
remove 1/2 a cup of liquid from both, and fill them
both to the top again this time using Cool-Aid for
both.
Now taste them both... Not exactly equal right?? ;-)
The same thing happens with strings, when you declare
strings as String[XX] you are telling TP to reserve enough
space for a maximum of XX caracters for that string. When
you write data to a string you are not overwriting it
completly if you don't write XX caracters to it. That is why
after my first test, there is still data after the "L" of
equal, only the length byte tells TP not to bother with what
might be left there. To convince youself, if you name the
two records 'REC1' and 'REC2', after you have done what I
said try this:
Rec1.Field1 [0] := #70;
Rec2.Field1 [0] := #70;
Writeln( Rec1.Field1 );
writeln( Rec2.Field1 );
You should get different results and remember your compare
function actually compares 100 bytes.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 20:55:39
From Mark Ouellet
To Trevor Carlsen
Subject Re: Question, Compression
On 25 Apr 92, you, Trevor Carlsen, of 3:690/644.0 wrote...
TC> {$REDFACE+}
TC>
TC> I cannot believe that I did not twig to your humour :-( Well done.
TC>
TC> BTW the 1meg:1 compression message - the first thing I did was to check
TC> if it was written on 1st April. When I saw that it was not, I thought
TC> to post a message that the writer must have heard this rumour on that
TC> date. Then I though better say nothing and just sit back and see how
TC> many would be sucked in. - The mind boggles...
TeeCee,
as a side note I tested Pkzip with a 4Meg file of
the same caracter, pkzip compressed it to about 4000 bytes.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 21:01:31
From Mark Ouellet
To Robert Jenkins
Subject Re: TP 6.0
On 25 Apr 92, you, Robert Jenkins, of 1:389/5.0 wrote...
RJ> I have a book called 'Mastering Turbo Pascal 6.0' by Tom Swan and it is
RJ> a GREAT book for beginners!! Cost about $25 or so...
Robert,
Does it have a TVision section?? If so how long and
how good ??
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/03 12:20:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 13:38:58
From Trevor Carlsen
To Max Maischein
Subject Bits and bytes
MM> Function Byte_2_Bin ( B : Byte ) : String;
MM> Var S : String[ 8 ];
MM> I : Byte;
MM> Begin
MM> S[ 0 ] := #8;
MM> For I := 0 to 7 do
MM> Begin
MM> If ( B and ( 1 shl ( 7-I ))) > 0
MM> then S[ I+1 ] := '1'
MM> else S[ I+1 ] := '0';
MM> End;
MM> Byte_2_Bin := S;
MM> End;
Here are two alternatives -
function BinStr(B: byte): string;
var x : byte;
begin
BinStr[0] := #8;
for x := 7 downto 0 do
BinStr[8 - x] := chr(ord('0')+ord(odd(B shr x)));
end;
procedure Bin2Str(var st: string; b: byte);
var x : byte;
begin
st[0] := #8;
for x := 7 downto 0 do
st[8 - x] := chr(ord('0')+ord(odd(B shr x)));
end;
The function BinStr is 11% faster than Bin_2_Str and the procedure Bin2Str
is 39% faster.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/03 12:20:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 14:26:14
From Trevor Carlsen
To Brian Stark
Subject Dynamic arrays...
GS> Array[0..65519] of byte; or whatever. Then you'll never get the
GS> compiler out of range error.
BS> Ok, but that defeats the purpose of creating the dynamic array. I
BS> would like to be able to create a structure that will contain a file's
BS> data, and nothing more.... Creating an array of 0..65519 wouldn't make
BS> sense as only a small part of it would be used -- probably less than
BS> 3K in my application.
No... a type declaration occupies NO memory. The memory allocation would
only be what you decided when it is allocated.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/03 12:20:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 17:30:33
From Trevor Carlsen
To Gerald Gutierrez
Subject Procedures...
GG> Let us consider two very simple, and yet common examples:
GG> Now -- obviously both these two examples are clearly understandable in
GG> their current state, but let's grab a text editor and put the 500
GG> lines into both of them. Now -- to indent improperly or not to indent
GG> at all would certainly be a very poor practice of a structured
GG> language. You have to insert one more Conditional in the beginning --
GG> say, is the food rotten ? Are you going to waste your time indenting
GG> properly every single line of your paticular source ? Another
GG> situation. Suppose you have to delete a conditional. ie: you don't
GG> care what type of food anymore, there you go again wasting time
GG> unindenting code.
Exits are unnecessary here. The 500 lines should be in another procedure,
or more to the point, in several other procedures.
GG> Another very common example. Let's say you have a routine in which you
GG> have level after level of IF statements. At the 7th level, you must
GG> check a certain variable for a critical error, and if the error is
GG> present, you must exit immediately. Please tell me how you would go
GG> around exiting this paticular situation immediately without execution
GG> of any more code, without using Exit.
This is a valid case when exits are desirable. There are many others also.
If they make code more readable then they should always be considered.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/03 12:20:52
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 00:00:00
From Terry Hughes
To Rob Kittredge
Subject Re: Looking for
RK>RK>Any plans on including SeaLink sometime in the future? It
RK>RK>is a variation of Xmodem...I have been able to write one
RK>RK>myself but it is nowhere near as fancy as any of Async
RK>RK>Pro's protocols!!! And probably not as reliable either!
RK>TH> Well, it is on the list of things-to-get-to but there are
RK>TH> quite a few things in front of it.
RK>If I may ask, what types of things are *LEFT* to add?? Only
RK>ZIP compression is all I can think of! :-)
In case you weren't aware, we added ZIP shrink and store to
APRO 1.03, leaving only ZIP implode and LHA 2.0 yet undone.
The other most immediate items are adding background
capabilities to Kermit and ASCII (Xmodem, Ymodem and Zmodem
were converted to background protocols in 1.03).
After that comes a host of smaller issues: more terminal
emulations, other protocols, more device layers and so on.
Many of these issues will likely take a back seat to the C and
Windows versions of APRO.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/05/04 07:42:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 00:00:02
From Terry Hughes
To Jud Mccranie
Subject B-Treee Filer Suggestion
JM>How about a "make data base application" similar to make menu and make
JM>screen for users of b-tree and *Pro? That would be really nice, and I
JM>don't think it would be that hard to do with make menu, make screen
JM>(especially) and the sample b-tree sample programs you already have.
JM>Then we could create database apps faster, quicker, better, and produce
JM>much better programs than dBase people. The make DB app would have the
JM>standard browse, editing, and printing facilities.
We've long planned higher level tools for B-Tree Filer,
including a data dictionary, query language and so on.
Unfortunately, those things keep getting assigned a lower
priority than other tools so I can't say when you might
actually see such products.
In case you weren't already aware, there is product out called
B-Tree Dictionary (by Turbo Toolware) that has a data
dictionary, query language and design tools that build on top of
B-Tree Filer and Object Professional. I don't have their number
here at home but if you call our office at the number below we
can get if for you.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/05/04 07:42:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 23:35:05
From Mark Ouellet
To Gerald Gutierrez
Subject Re: Freq it !
On 23 Apr 92, you, Gerald Gutierrez, of 1:153/715.5 wrote...
GG> Hi Mark -- apologies for the late notice. I have sent it up to my host
GG> already under the filename EXP_SRC.ARJ.
thanks Gerald,
I'll go and pick it up.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/04 15:12:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-02-92 23:44:30
From Mark Ouellet
To Greg Johnson
Subject Re: Network Game
On 26 Apr 92, you, Greg Johnson, of 1:232/32.0 wrote...
GJ> I'm going to butt in here for a minute...can you send it to me also...I
GJ> can
GJ> send you postage?
Greg,
David put it up for freq and download as you
probably have seen if you followed the thread.
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/04 15:12:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 15:23:14
From Mark Ouellet
To Ruurd Pels
Subject Re: Shelling To Dos
On 22 Apr 92, you, Ruurd Pels, of 2:512/23.0 wrote...
BB>> Is there a simple way to have my compiled PASCAL program shell to
BB>> DOS?
BB>> I don't need to shell to do anything serious: just a quick look
BB>> around
BB>> the drive, run a small program, etc. In QuickBasic, there is a
BB>> command
BB>> called SHELL, that allows you to go to DOS, and to type 'EXIT' when
BB>> you
BB>> are ready to leave. Anything equivalent in TP 5.5? Thanks for any
BB>> help.
RP> Look up System().
Ruurd,
wrong language, right answer (For that other
language).
Don't you think EXEC would be more apropriate ;-)
Best regards,
Mark Ouellet.
--- ME2
* Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
* Tossed by SFToss v1.00b on 92/05/04 15:12:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 12:13:00
From Werner Berghofer
To Robert Soubie
Subject SAA/CUA standards
Robert,
> The point with this "standard" is that it is adapted
> to english, not to foreign languages.
please keep in mind that English is worldwide the "official" EDP language
Speaking for my person I'm very happy with this. IMHO there's nothing more
ridiculous and questionable than user interfaces or documentations which have
been translated from English to another language.
Computer related terminilogy has its origins in English, most of its
conceptions and terms simply are not translatable. If I have to use a program
with a German user interface nearly always I translate its menus back into
English to figure out what for heaven's sake they mean. Of course the better
solution would be to delete this program ;-)
I even comment my Pascal sources in English; writing German would sacrifi
e most of its unequivocal brevity.
Werner.
---
* Origin: ! (2:310/90.100)
* Tossed by SFToss v1.00b on 92/05/04 15:12:50
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 20:32:00
From Norbert Igl
To Matt Heck
Subject SoundBlaster Source Code...
> Everyone is looking for Soundblaster/AdLib source code.
> The reality is:
> No one has any.
> Not one person.
> None. At all.
hmmm...there must have been something....(seek...)...BINGO!
-------------------------8<---------------------------------
Wed 29 Jan 92
By: Patrick Maartense
To: Gerald Gutierrez
Re: Accessing the SB 1/3
---------------------------------------------------------------------------
{---------------------------------------------------------------------------
Unit SBVoice (v1.00) for Turbo Pascal 6.0
For interfacing with the SoundBlaster's digitized voice channel.
Copyright (c) 1991, Amit K. Mathur, Windsor, Ontario.
By: Amit K. Mathur
3215 St. Patrick's Drive
Windsor, Ontario
N9E 3H2 CANADA
Ph: (519) 966-6924
Networks: RIME(tm) R/O ->WINDSOR, ILink (Shareware), NA-Net (Gaming),
WWIVNet (#198@5950), or direct on NorthSTAR (519)735-1504.
These routines are released to the public domain. However I will gladly
accept contributions towards further development of this and other products.
Please send any changes or improvements my way. And I'm interested in
other SoundBlaster utilities and programming tools. Thanks in advance.
--------------------------------------------------------------------------}
{$O+,F+}
{ Allow this Unit to Be Overlayed (doesn't affect compilation if you decide
not to overlay it), and force far calls. }
unit SBVoice;
interface
uses MemAlloc; { Memory Allocation Proc }
var SoundFile: Array[1..25000] of byte; { whatever size you want }
sgSBDriver, ofSBDriver: word; { seg and ofs of Driver }
SBDriver: Pointer; { pointer to the driver }
StatusWord: Word; { stores SB status }
procedure loaddriver(fi:string);
{ Loads CT-VOICE.DRV into memory. 'fi' is the path to the driver. }
procedure closedriver;
{ Clean up routine. Not really necessary if your program is over. }
procedure loadvoice(f:string;start,size:word);
{ Load 'f' into memory. Start is the start of the area within
'f' to load and size is the amount to laod. If you set size to 0
then it will load the entire file. }
function sb_getversion:integer;
{ Get the version number of the CT-VOICE.DRV
Returns the Version number }
function sb_init:integer;
{ Initialize the SoundBlaster. Call this right after load driver, unless
you have to change the BaseIOAddress or Interrupt number and haven't
changed the CT-VOICE.DRV file itself.
Returns: 0 - no problem
1 - sound card failiure
2 - I/O failiure
3 - DMA interrupt failiure }
procedure sb_output(sg,os:word);
{ Output the digitized sound. You must load the sound first!
sg and os are the segment and offset of either SoundFile or whatever
array you use to store the sound. If you use a .VOC file then call
with 26 added to the offset. }
procedure sb_setstatusword(sg,os:word);
{ Sets the location of the status word. This is the third thing you should
do, after loading the driver and initializing it.
The StatusWord will contain $0FFFF if input/output is in output, and
0 when it's done. It will also hold the values of the markers in voice
files if any are encounterred, allowing you to coordinate output with
your programs. }
procedure sb_speaker(mode:word);
{ Set the speaker on/off. Off is mode 0, and On is anything else. This
is the fourth thing you should do in your initialization. }
procedure sb_uninstall;
{ Uninstall the driver from memory. Used by CloseDriver. }
procedure sb_setIOaddress(add:word);
{ Override the IOaddress found inside the CT-VOICE.DRV file. Add is the
new IO address. }
procedure sb_setinterruptnumber(intno:word);
{ Allows you to override the Interrupt number in the driver. IntNo is your
new interrupt number (3, 5, 7 or 9). }
procedure sb_stopoutput;
{ Stops the output in progress }
function sb_pauseoutput: integer;
{ Pauses the output in progress.
Returns: 0 - success
1 - fail }
function sb_continueoutput: integer;
{ Continues a paused output.
Returns: 0 - success
1 - fail (nothing to continue) }
function sb_breakloop(mode:word): integer;
{ Breaks out of the currect output loop.
Modes: 0 - continue round, stop when done
1 - stop immediately
Returns: 0 - success
1 - not in loop }
procedure sb_input(highlength,lowlength,seginputbuff,ofsinputbuff:word);
{ Input digitized sound.
HighLength: The high byte of the length of the input buffer.
LowLength: The low byte of the length of the input buffer.
SegInputBuff: The Segment of the start of the input buffer.
OfsInputBuff: The Offset of the start of the input buffer. }
procedure sb_setuserfunction(segaddress,ofsaddress:word);
{ Sets up a user function that the SB calls when it encounters a new data
block. It must perform a FAR ret, preserve DS,DI,SI and flag register.
Clear Carry flag if you want the driver to process the block, or set it
if your routine will. It must be clear if the block type is 0, that
is the terminate block.
SegAddress is the segment of your user function in memory.
OfsAddress is the ofset of your user function in memory. }
implementation
uses DOS;
procedure Abort(s:string);
begin
writeln('The Following Error Has Occurred: ',s);
writeln('Remedy and try again. We apologize for any inconvenience.');
halt(1);
end;
procedure loaddriver(fi:string);
var f: file;
k: integer;
t: string[8];
begin
assign(f,fi+'CT-VOICE.DRV');
{$I-} Reset(f,1); {$I+}
if IOResult <> 0 then
Abort('Cannot Open '+fi+'CT-VOICE.DRV');
blockread(f,Mem[sgSBDriver:ofSBDriver],filesize(f));
close(f);
t:='';
for k:=0 to 7 do
t:=t+chr(Mem[sgSBDriver:ofSBDriver+k+3]);
if t<>'CT-VOICE' then
abort('Invalid CT-VOICE Driver!');
end;
procedure closedriver;
begin
sb_uninstall;
if dalloc(sbdriver)=0 then
abort('Uninstall Error!');
end;
procedure loadvoice(f:string;start,size:word);
var fi: file;
k: word;
begin
assign(fi,f);
{$I-} Reset(fi,1); {$I+}
if IOResult <> 0 then
abort('Cannot Open '+f+'!');
k:=0;
seek(fi,start);
if size=0 then size:=filesize(fi);
blockread(fi,Mem[seg(soundfile):ofs(soundfile)],size);
close(fi);
end;
function sb_getversion: integer; assembler;
asm
push bp
mov bx,0
call SBDriver
pop bp
end;
procedure sb_setIOaddress(add:word); assembler;
asm
push bp
mov bx,1
mov ax,add
call SBDriver
pop bp
end;
procedure sb_setinterruptnumber(intno:word); assembler;
asm
push bp
mov bx,2
mov ax,intno
call SBDriver
pop bp
end;
procedure sb_stopoutput; assembler;
asm
push bp
mov bx,8
call SBDriver
pop bp
end;
function sb_init: integer; assembler;
asm
push bp
mov bx, 3
call SBDriver
pop bp
end;
function sb_pauseoutput: integer; assembler;
asm
push bp
mov bx,10
call SBDriver
pop bp
end;
function sb_continueoutput: integer; assembler;
asm
push bp
mov bx,11
call SBDriver
pop bp
end;
function sb_breakloop(mode:word): integer; assembler;
asm
push bp
mov bx,12
mov ax,mode
call SBDriver
pop bp
end;
procedure sb_output(sg,os:word); assembler;
asm
push bp
push di
mov bx,6
mov di,os { offset of voice }
mov es,sg { segment of voice }
call SBDriver
pop di
pop bp
end;
procedure sb_input(highlength,lowlength,seginputbuff,ofsinputbuff:word);
assembler;
asm
push bp
push di
mov bx,7
mov dx,highlength
mov cx,lowlength
mov es,seginputbuff
mov di,ofsinputbuff
call SBDriver
pop di
pop bp
end;
procedure sb_setstatusword(sg,os:word); assembler;
asm
push bp
push di
mov bx,5
mov di,os
mov es,sg
call SBDriver
pop di
pop bp
end;
procedure sb_speaker(mode:word); assembler;
asm
push bp
mov bx,4
mov ax,mode
call SBDriver
pop bp
end;
procedure sb_uninstall; assembler;
asm
push bp
mov bx,9
call SBDriver
pop bp
end;
procedure sb_setuserfunction(segaddress,ofsaddress:word); assembler;
asm
push bp
mov dx,segaddress
mov ax,ofsaddress
mov bx,13
call SBDriver
pop bp
end;
begin {set up SB}
If DOSMemAvail < 2500 then { lower the heap }
abort('Not Enough Memory'); { with $M to fix }
StatusWord:=MAlloc(SBDriver,2500);
if StatusWord<>0 then
abort('Memory Allocation Error');
sgSBDriver:=MemW[seg(SBDriver):ofs(SBDriver)+2];
ofSBDriver:=MemW[seg(SBDriver):ofs(SBDriver)];
Loaddriver('d:\sb\drv\'); { change at will }
if sb_init<>0 then { or stick in your }
abort('SoundBlaster Initialization Error!'); { own program init }
sb_setstatusword(seg(statusword),ofs(statusword)); { see above }
sb_speaker(1); { again! }
end.
---------------------------------------------------------------------------
Wed 29 Jan 92
By: Patrick Maartense
To: Gerald Gutierrez
Re: Accessing the SB 2/3
---------------------------------------------------------------------------
Unit MemAlloc;
{ Purpose is to provide the ability to create (destroy) dynamic variables }
{ without needing to reserve heap space at compile time. }
Interface
Function Malloc(Var Ptr; Size : Word) : Word;
{ Allocate free memory and return a pointer to it. The amount of memory }
{ requested from DOS is calculated as (Size/4)+1 paragraphs. If the }
{ allocation is successful, the untyped VAR parameter Ptr will be populated }
{ with the address of the allocated memory block, and the function will return}
{ a zero result. Should the request to DOS fail, Ptr will be populated with }
{ the value NIL, and the function will return the appropriate DOS error code. }
Function Dalloc(Var Ptr) : Word;
{ Deallocate the memory pointed to by the untyped VAR parameter Ptr }
Function DosMemAvail : LongInt;
{ Return the size of the largest contiguous chuck of memory available for use }
{ --------------------------------------------------------------------------- }
Implementation
{ --------------------------------------------------------------------------- }
Function Malloc(Var Ptr; Size : Word) : Word;
Begin
Inline(
$8B/$46/<SIZE/ { mov ax,[bp+<Size]}
$B9/$04/$00/ { mov cx,4}
$D3/$E8/ { shr ax,cl}
$40/ { inc ax}
$89/$C3/ { mov bx,ax}
$B4/$48/ { mov ah,$48}
$CD/$21/ { int $21 ;Allocate
memory}
$72/$07/ { jc AllocErr ;If any
errors ....}
$C7/$46/$FE/$00/$00/ {NoErrors: mov word [bp-2],0 ;Return 0
for successful allocation}
$EB/$05/ { jmp short Exit}
$89/$46/$FE/ {AllocErr: mov [bp-2],ax ;Return
error code}
$31/$C0/ { xor ax,ax ;Store a
NIL value into the ptr}
$C4/$7E/<PTR/ {Exit: les di,[bp+<Ptr] ;Address
of pointer into es:di}
$50/ { push ax ;Save the
Segment part}
$31/$C0/ { xor ax,ax ;Offset is
always 0}
$FC/ { cld ;Make sure
direction is upward}
$AB/ { stosw ;Store
offset of memory block}
$58/ { pop ax ;Get back
segment part}
$AB); { stosw ;Store
segment of memory block}
End {Malloc};
{ --------------------------------------------------------------------------- }
Function Dalloc(Var Ptr) : Word;
Begin
If Pointer(Ptr) <> NIL then begin
Inline(
$B4/$49/ { mov ah,$49}
$C4/$7E/<PTR/ { les di,[bp+<Ptr]}
$26/$C4/$3D/ { es: les di,[di]}
$CD/$21/ { int $21}
$72/$02/ { jc Exit}
$31/$C0/ {NoError: xor ax,ax}
$89/$46/$FE); {Exit: mov [bp-2],ax}
Pointer(Ptr) := NIL;
end {if}
else
Dalloc := 0;
End {Dealloc};
{ --------------------------------------------------------------------------- }
Function DosMemAvail : LongInt;
Begin
Inline(
$BB/$FF/$FF/ { mov bx,$FFFF}
$B4/$48/ { mov ah,$48}
$CD/$21/ { int $21}
$89/$D8/ { mov ax,bx}
$B9/$10/$00/ { mov cx,16}
$F7/$E1/ { mul cx}
$89/$46/$FC/ { mov [bp-4],ax}
$89/$56/$FE); { mov [bp-2],dx}
Continued next message...
* Tossed by SFToss v1.00b on 92/05/04 15:12:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 20:32:00
From Norbert Igl
To Matt Heck
Subject SoundBlaster Source Code...
... Continued from previous message
end {DosMemAvail};
End {Unit MemAlloc}.
---------------------------------------------------------------------------
Wed 29 Jan 92
By: Patrick Maartense
To: Gerald Gutierrez
Re: Accessing the SB 3/3
---------------------------------------------------------------------------
{$M 16384,0,0}
program Demo; { to demonstrate the SBVoice Unit }
{ Copyright 1991 Amit K. Mathur, Windsor, Ontario }
uses SBVoice;
begin
if paramcount>0 then begin
LoadVoice(paramstr(1),0,0);
sb_Output(seg(soundfile),ofs(soundfile)+26);
repeat
write('Demo of the SBVoice Unit, Copyright 1991 by Amit K. Mathur ---
');
until StatusWord=0;
end else
writeln('Usage: DEMO [d:\path\]filename.voc');
end.
-------------------------8<---------------------------------
sorry 'bout the line breaks...
Bye from Germany, Norbert
---
* Origin: STOP READING! You're leaving the MSG-sector (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/05/04 15:12:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 21:02:01
From Norbert Igl
To Trevor Carlsen
Subject 16550 chip
> Does anybody have any Pascal (or assembler) code that will
> demonstrate a fool-proof way of determining if the UART is a 16550,
> 16450 or 8250?
Hmmm... difference between 8250/16450, no.
But, here we go....
-------------------------8<---------------------------------
Const ComPortText : Array[0..4] of String[12] =
(' N/A ','8250/8250B','8250A/16450','16550A','16550N');
IIR = 2;
SCRATCH = 7;
Var PortAdr : Array[1..4] of Word absolute $40:0;
function ComPortType(ComX:byte):byte;
BEGIN
ComPortType:=0;
if (PortAdr[ComX] =0)
or (Port[PortAdr[ComX]+ IIR ] and $30 <> 0)
then exit; {No ComPort !}
Port[PortAdr[ComX]+ IIR ] := 1; {Test: enable FIFO}
if (Port[PortAdr[ComX]+IIR] and $C0) = $C0 {enabled ?}
then ComPortType := 3
else If (Port[PortAdr[ComX]+IIR] and $80) = $80 {16550,old version..}
then ComPortType := 4
else begin
Port[Portadr[ComX]+SCRATCH]:=$AA;
if Port [Portadr[ComX]+SCRATCH]=$AA {w/ scratch reg. ?}
then ComPortType:= 2
else ComPortType:= 1;
end;
END;
{ ...test...}
var com : byte;
begin
writeln('COMPORT-CHIPTEST Norbert Igl,2:241/5300.3');
for com := 1 to 4 do
writeln(' Com',com,' chip type : ',ComPortText[ComPortType(com)]);
end.
------------------------->8---------------------------------
Bye from Germany, Norbert
---
* Origin: i486SX not found! Use Co-processor instead? (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/05/04 15:12:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-04-92 09:36:36
From Trevor Carlsen
To Jud Mccranie
Subject Re: Features Lacking In T
TC> consumer legislation that allows you to return the product for
TC> refund if it does not stand up to claims or is unsuitable for
TC> the use it is intended for.
JM> I think here it is a little different. You can get a refund
JM> if it doesn't live upto claims, but if it is unsuitable that
JM> may be your tough luck if it works as advertised. Some
JM> companies are a little nicer and will allow you to return
JM> within 30 days for whatever reason.
I think that yours is similar to here. By unsuitable for the use for which
it is intended, it means the use the vendor intended. So in Turbo Pascal's
case, if it would not correctly compile Turbo Pascal source code to a correctly
working executable.
You might say that "works as advertised" is the same thing. Not so. eg.
I once bought a compiler that worked as advertised but the advertisement omitted
to say that the compiler would sometimes produce different output for source
code that was identical except for comments. Nor was this possibility covered
in the documentation. In other words a serious bug. (In fact it cost me thousan
s of dollars on the contract I had at the time.) That compiler was unsuitable
for the job that it was intended to be used for - general purpose programming.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/04 15:12:56
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 16:47:44
From Dj Murdoch
To Derek Mahar
Subject Re: Pointers as function results (was: P
DM> Are constructors in Pascal automatically executed when an
DM> object is declared? What is the purpose of a constructor
DM> besides initializing fields?
Constructors aren't in standard Pascal; the only object Pascal I know anything
about is Turbo Pascal (though there are others), so I'll answer your questions
with regard to it.
Constructors are never executed automatically. You have to explicitly call
them, either when a dynamic object is allocated, e.g.
New(Myobjptr, init);
or afterwards, e.g.
New(Myobjptr);
Myobjptr^.init;
These two fragments are equivalent.
As far as the compiler is concerned, the only things that are special about
a constructor are:
1. You're allowed to use that special New syntax to call it.
2. In its prologue, it initializes the pointer to the virtual method
table for the object; if that's not done, virtual methods can't be called
correctly. (You can override this behaviour if you need to.)
I think a good general style is to put any initialization code into the construc
or, too.
DM> When are destructors executed?
Again, only when you explicitly ask them to be. The usual ways to call a
destructor are
dispose(myobjptr, done); { Calls myobjptr^.done before disposing }
or, in a destructor's code,
TParent.done;
I've only ever needed to have one destructor per object type, and I follow
the convention of calling it "Done", but the compiler doesn't care how many
you have.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 16:59:23
From Dj Murdoch
To Keith Dombrowski
Subject Re: EMS w/Overlays
KD> Well, actualy it never happens in the IDE, but the
KD> second one may be the ticket, the door library I am using
KD> has it's own exit procedure and as I don;t have the
KD> source, I can't tell if it is executing the default one.
KD> Thanks for the info, I'll have to send the author a netmail about it.
Here's an easy way to tell: create an exit procedure that prints a message
and then calls the old one. Be sure it gets installed before the door library's
(by putting the unit first in the Uses list), and then see if the message
comes out. If not, try putting it last in the Uses list, just to be sure
that it's not your mistake.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 17:03:13
From Dj Murdoch
To Jud Mccranie
Subject Re: Features Lacking In Tp
DM> I don't see any need for static data greater than 64K, but I'd
JM> Well, it is much easier and faster if you have data available in memory,
JM> and if you have more than 64K of it, you need more than 64K.
I really don't see that you've got any reason to believe it would be faster.
If you've got more than 64K of static data, the compiler is going to have
to fiddle around with multiple segments to get at it. It can probably do
it a little better than you can, but not a lot.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 17:39:11
From Dj Murdoch
To J J Marquez
Subject Re: dectecing coprocessor
JJ> That's like dialing a number, NOT getting a ring, and
JJ> having the phone company say "Well, you never SAID
JJ> anything, how do you KNOW the call wasn't completed ?".
JJ> Inclusion and use of the TEST8087 item in a user program
JJ> ought to work, even if you do nothing else. Or, AT LEAST
JJ> have the docs clearly tell you that it won't work without
JJ> the other code present.
One fix could be to make TEST8087 into a function, instead of a variable.
If it was in the fpu code block, it would always pull in the detector code
when you called it.
Another would be to pull TEST8087 out of the single block of SYSTEM constants,
and to put it in a different block of constants, which also contained a pointer
to some fpu code.
Both of these would break existing code (e.g. my CLEARMEM unit), but only
if the code was doing things it shouldn't do. (CLEARMEM's Clear_Globals procedu
e is very version dependent.) I'd prefer a note in the doc's, rather than
either of the changes I suggested. Both would add unnecessary overhead.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 17:47:50
From Dj Murdoch
To Chris Whitney
Subject Re: MOVEing files vs. co
CW> I've had problems with this procedure (in TP 6) It gives me error 103
CW> I think.. REALLY annoying to have to shell to dos and 'REN' it.. I even
CW> tried using an assembly version of it in TP and got the same error..
CW> path not found. One strange thing is that I put a space in the quote
CW> before it and it worked, and another time that it worked it took off the
CW> first character! Do you have to put a '.\' or something in it to work
CW> properly? BTW: I'm trying to rename a file in the same directory
CW> REN FILE1.TXT FILE2.TXT <- like that in dos.
I haven't had problems. Could you post the code that doesn't work?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 17:49:52
From Dj Murdoch
To Roger Joelsson
Subject Re: Complex calculating in Pascal
RJ> I'm working on a way to handle complex expressions in
RJ> Pascal. I've thought of many ways of doing it, but I think
RJ> defining a RECORD containing a Real variable for the real
RJ> part of the expression and aother Real variable containing
RJ> the imaginary part.
RJ> That would be something like:
RJ> Expr.Re := 4; (* real *)
RJ> Expr.Cx := 2; (* imaginary *)
RJ> This would mean
RJ> 4 + 2i
RJ> Is this the right way of implementing this, are any other ways?
RJ> Would be glad to hear a little from you about this..:-)
That's the most straightforward way. The only problem is that functions can't
return records, so you have to do all your calculations in procedures with
Var parameters. A very clever way around this that Terry Ritter showed to
me is something like the following:
Type
Float = double; { Or use Float = real if you like. }
Tcomplex = string[2*sizeof(Float)];
{ This is the type that you declare variables to be }
Tcomplex2 = record { This is the type used internally }
lenbyte : byte; { This byte should always be set to 2*sizeof(Float)
Re, Im : float;
end;
Now you can have functions that take Tcomplex arguments and return Tcomplex
values. Internally, they typecast arguments to Tcomplex2 to work with them.
For example,
Function Complex(Realpart,Imagpart:Float):TComplex; { Make a complex number. }
var
result : TComplex2;
begin
with result do
begin
lenbyte := 2*sizeof(Float); { Essential! }
re := realpart;
im := imagpart;
end;
Complex := TComplex(result);
end;
Function CMul(x,y:TComplex):TComplex; { Multiply two complex numbers. }
var
result : TComplex2;
x2 : TComplex2 absolute x; { This is one way to do a typecast }
y2 : Tcomplex2 absolute y;
begin
CMul := Complex( x2.Re*y2.Re - x2.Im*y2.Im,
x2.Re*y2.Im + x2.Im*y2.Re);
end;
Then you can figure out (1+3i)*(5-5i) by the expression:
result := CMul(Complex(1,3),Complex(5,-5));
I haven't tested this code; it probably has some errors, but should give you
the idea.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 18:03:47
From Dj Murdoch
To Sean Ocker
Subject Re: COM instead of EXE
SO> Hello. I am not dumb, I have tried to use the DOS 5.0 EXE2BIN to
SO> do this, but need to know how to make a COM file instead of an
SO> EXE when compiling. Is there no hope if DOS won't do it?
TP (versions 4+) can't produce executables that will work in COM format.
There are utilities that supposedly correct this (though I have my doubts).
The simplest solution is just to give up on getting a COM format, and be
satisfied with a .COM extension:
rename myprog.exe myprog.com
There are almost no places where you really need COM format anyways, in DOS 3+.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-03-92 21:06:21
From Dj Murdoch
To All
Subject TP 6.0 bug list (release 6)
I've just released the 6th version of my unofficial TP 6.0 bug list. It's
gone out as TP6BUGS6.ZIP on the PDN Pascal file echo, and should be available
on the Internet soon as /pc/turbopas/tp6bugs6.zip on garbo.uwasa.fi, and on
Compuserve in CLMFORUM DL 16 as TPBUGS.ZIP (watch out for version 5 there,
with the same name!).
The current version (which I hope is the last for TP 6.0 - c'mon Borland,
let's have 7.0!) describes about 75 bugs, and provides 5 fixes. Most of these
bugs are *very* obscure, but I've included them for the sake of completeness.
The full list is too long to post here now, but I've extracted the 20 new
entries below.
------ Cut here ---------
If the Objects unit is overlaid, calls to stream or collection Error methods
can cause system crashes.
The Drivers unit misses keystrokes if the keyboard buffer has been reallocated.
Extensions to the Drivers unit INT09 (keyboard interrupt) handler won't work
when run within the IDE, because the interrupt handler won't be installed.
A window that has neither the wfGrow now wfMove flags set does not disable
the cmResize command when it is active. (A fix is available: see TWindow.fix
in TP6BUGSn.ZIP).
The compiler doesn't detect overlapping case constants. Only the first matching
case is executed.
The Delay() routine in CRT gives inaccurate delays on some very fast machines.
A patch (DELAY.FIX) from Borland is included in TP6BUGSn.ZIP.
The SetViewPort procedure accepts X1=X2 or Y1=Y2 (contrary to the documentation)
but clipping doesn't work properly with these settings.
TopText, CentreText, and BottomText are defined differently for DefaultFont
and stroked fonts.
Single and Double types typed constants are not correctly initialized for
absolute values smaller than 1.17xxxxE-38 respectively 2.22xxxxE-308 (their
value wil be zero instead). The lower limit of the dynamic range should be
1.5E-45 and 5.0E-324 respectively.
App.ISqr enters an endless loop for arguments greater than 32760.
Graph.SetTextJustify doesn't properly account for descenders; they can be
clipped at the bottom of the screen.
BASM has the ranges of legal values incorrect for IN, OUT, INT, ENTER, AAM,
AAD instructions.
BASM allows references to nonexistent registers on the coprocessor, e.g.
FADD ST, ST(123456)
The IDE doesn't properly single step across AAM xx and AAD xx instructions.
BASM doesn't do proper checking on CALLs and JMPs to near/far procedures or
absolute variables, and sometimes doesn't generate proper code, e.g.
JMP FAR PTR AbsoluteVariable { AbsoluteVariable is declared absolutely }
CALL FAR PTR AbsoluteVariable
BASM doesn't flag the statements
MOV AX, [WORD]
MOV BYTE PTR AL,5 as nonsense.
The coprocessor emulator doesn't handle special arguments like INF and NaN
properly. Quiet NaNs are treated as signalling NaNs, and operations on INF
return NaN.
The Random function will return 1.0 once every 2^32 calls in $N+ mode. This
value should be folded to 0.0, so that Trunc(N*Random) can't return N.
TRect.Union and TRect.Intersect don't perform set operations. If two rectangles
don't intersect, TRect.Intersect always returns ((0,0),(0,0)); the union of
that empty rectangle with any other rectangle always includes the point (0,0).
The Str procedure rounds nnn.5 differently than either the Round or Trunc
functions when printing reals with no decimal places. In $N- mode, it is
inconsistent; in $N+ mode, it consistently rounds up.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/05 07:59:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 00:48:28
From Trevor Carlsen
To Jose Campione
Subject NEED SOME HELP
JC> The following little example allows toggling of the three keys in any
JC> combination. Hope it's useful:
JC> if key and bit = bit then key:= key xor bit
JC> else key:= key + bit;
As you are trying to toggle the appropriate bit the else is redundant. Just
key := key xor bit;
is all that is required.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/05 18:47:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 01:16:01
From Trevor Carlsen
To Benjamin Schollnick
Subject Re: Procedures...
BS> Repeat
BS> Until True = False;
TC> That is a perfectly valid technique. I use it frequently
TC> in input loops where it can make the code cleaner and more
TC> readable. Usually I add a comment like - { halt occurs in
TC> procedure ProcessInput if escape key pressed }
BS> Tc, I guess it's just my "UNCONVENTIAL" thinking here....(Or
BS> me just complaining, which I do sometimes)....But my logic
BS> is that there is NO WAY OUT OF THAT LOOP UNLESS YOU EXIT....
The whole point of such a loop is that there should be no way out. The program
can thus only be halted from the procedure in which the halt statement is
used. If you don't like this style, that's fine. Everyone to their own :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/05 18:47:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 01:20:02
From Trevor Carlsen
To David G. Edwards
Subject Re: Features Lacking In Tp
DG> I doubt that you've ever been bitten by using an uninit'd pointer or
DG> forgotten to dispose of something, but I have...
Oh for that to be true! (It does not happen so frequently now though - especial
y as my TCLint source checker continues to develop nicely!)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/05 18:47:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-04-92 21:14:16
From Dj Murdoch
To John Gohde
Subject Re: A Virtuous Pascal ...
JG> POINT TWO: There is a market for a simple and stable real world
JG> version of Pascal. And, this market segment consists of
JG> educational institutions, students of programming under 18 years
JG> of age, and long term casual programmers in general. And,
JG> Stability of a module format would be as much a virtue as
JG> simplicity would be in regards to promoting Pascal as a
JG> programming language.
I'm not sure what you mean by "real world" version of Pascal, but I think
you're right that a lot of academics don't like Turbo Pascal. I've recently
had it explained to me by a couple of people teaching first year university
courses in programming:
TP is a terrible language to use for that purpose. It's not stable, it's
not simple, it's not Pascal, it's not portable.
Their ideal language would be a faithful implementation of standard Pascal,
without a lot of language extensions to confuse students. I think they'd
prefer no modules at all, since standard Pascal doesn't have them.
I've never taught programming, but I sure wouldn't want to be a student in
a course as these people describe it. Standard Pascal is, in my opinion,
a far inferior language to Turbo Pascal. (At least one of the academics I
was talking to agreed with this, but didn't see that a first programming course
should teach a useful language.)
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:45
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-04-92 21:25:27
From Dj Murdoch
To Matt Heck
Subject Re: Cyrix Coprocessor
MH> Any difference between the 486 internal math routines and the 387's?
Very little. According to Intel's 486 Programmer's Reference Manual:
The CR0 control register bits dealing with the FPU are different in the 486
than the 386; there are differences upon hardware reset; some exceptions occur
slightly differently.
The one worrisome one is the last one, which I'll quote:
"On the i486 processor, transcendental instructions can be aborted at certain
checkpoints during execution if an INTR is pending. Transcendental instructions
should there be used only in an environment where INTRs are not expected to
come as close as 200 clocks apart."
I really don't see how you can have any control over this: if you're running
interrupt driven I/O, you'll get lots of interrupts; you'll always get timer
ticks; you can also get interrupts from the mouse, the disks, etc. How are
you supposed to know if interrupts aren't going to come as close as 200 clocks
apart !?!
Perhaps I'm misinterpreting this paragraph.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:45
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-04-92 22:14:03
From Dj Murdoch
To Greg Smith
Subject Re: Sbp+
GS> By ALL memory models I assume they mean all Real Mode memory models.
GS> This being the case, yes the 64k limit would exist. The processor
GS> limits us to this. Please correct me if I'm wrong here.
Most current compilers other than TP have some sort of "huge" structures,
which are bigger than 64K. These are handled in real mode by doing arithmetic
on the segment registers. For example, the line
x[i] := 5;
where x is an array of 10 integers in TP compiles to
0000:0015 8B3E5800 MOV DI,[I]
0000:0019 D1E7 SHL DI,1
0000:001B C78542000500 MOV [WORD PTR DI+0042h],0005h
while the MS Fortran line
x(i) = 5
with x declared to be an array of 50000 integers compiles to
0000:000C B89E86 MOV AX,869Eh
0000:000F 99 CWD
0000:0010 050000 ADD AX,0000h
0000:0013 83D200 ADC DX,+00h
0000:0016 B90C00 MOV CX,000Ch
0000:0019 D3E2 SHL DX,CL
0000:001B 81C24903 ADD DX,0349h
0000:001F 8EC2 MOV ES,DX
0000:0021 8BD8 MOV BX,AX
0000:0023 26C7070500 MOV [ES: WORD PTR BX],0005h
As you can see, huge arrays carry a lot of overhead, but they do really help
sometimes.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:46
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 07:55:09
From Dj Murdoch
To All
Subject Standard I/O in TP?
I remember a couple of years ago Charles Falconer announced here that he had
put together a TP unit to act as a substitute for TP's lack of standard Pascal
file I/O - the one character lookahead, etc.
Does anyone have a copy or know where I could find one? If not, does anyone
know of a way to contact Charles?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:46
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 18:35:44
From Dj Murdoch
To Basil Groman
Subject Re: COM instead of EXE
BG> TP 3.0 will but not TP 4.0+. To create a com file the
BG> program would have to be compiled in the Tiny memory model
BG> (code+data <= 64k AND all in one segment) Starting with TP
BG> 4.0, TP uses a single data segment and 1 or more code segments.
> Just wanna know,
BG> Just hope I was right. :) I'm sure that if I'm wrong
BG> somebody will be kind enough to inform me.
I always try to be kind: all TP 4+ versions always use at least 2 code segments
one each for the main program and the System unit.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:46
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 18:39:03
From Dj Murdoch
To All
Subject TP on an HP calculator?
HP has a calculator (called the HP 95 LX, I think) which is a little DOS machine.
You can buy programs on ROM cards. Does anyone know if TP is available that way,
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:46
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-05-92 18:43:02
From Dj Murdoch
To Gerald Gutierrez
Subject Re: LZW ? / Bit shifting ??
GG> Oh yes... Question #2. Does anyone have a type of
GG> procedure which will take
GG> in a pointer to an array of bytes, then shift their bits
GG> left or right a number of 'spaces' ?? I mean this in the
GG> format of the procedure as something like:
...
GG> A := #15#15#15#15#15;
GG> { 00001111 00001111 00001111 00001111 00001111 }
GG> After executing ShiftBits ( @A, 33, 2 );
GG> -- move a max of 33 *BITS*
GG> A = #14#195#195#195#195#195;
GG> { 00001110 01000011 11000011 11000011 11000011 }
I have some general routines for bit operations. They're part of my Streams
unit (the unreleased part!). The idea would be to treat A as a stream of
bits, then copy 33 bits of it to another stream of bits. You'd get the shift
by skipping some or adding some zeros.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/06 10:37:46
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 02:13:53
From Trevor Carlsen
To Gordon Tackett
Subject 16550 chip
GT> BTW I though you had Async Pro? is there a problem with there code for
GT> this function?
Yeah...and I never gave it a thought! :-( Needless to say all I required
was in there. Thanks to all who helped.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/06 22:07:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 02:24:18
From Trevor Carlsen
To Shelby Crane
Subject Re: $80?
SC> Well, I just bought Tom Swan's Mastering Turbo Pascal 6.0
SC> but I can't find a list of the $thingas... I did find that
SC> $01 was escape and $02 was 1... haha...do you have a program
SC> what will list these or whatever?
The full list of scan codes for all the keys is on page 354 of the TP6 Programme
's guide.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/06 22:07:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 02:33:06
From Trevor Carlsen
To Robert Johnston
Subject Error Levels
SC> How does a TP program read an errorlevel out of a program it just
SC> shelled to?
RJ> Check the DosExitCode like...
RJ> Procedure Checkit;
RJ> Begin
RJ> Exec(GetEnv('COMSPEC'),'/C ERROR.EXE');
RJ> Case DosExitCode of
RJ> 1 :
RJ> Begin
RJ> Writeln('Error level 1 passed from program');
RJ> Halt;
RJ> End;
RJ> 2 : Exit;
RJ> End;
RJ> End;
This will not work. To prove it to yourself, write a program error.exe that
always returns errorlevel 1 on termination. The message indicating this will
never be printed by the above program.
This is because the errorlevel you are checking with DosExitCode is that which
is being returned by the command interpreter and not error.exe.
To get error.exe's exitcode you must execute it as a direct child process
and not by the command processor.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/06 22:07:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 14:00:24
From Trevor Carlsen
To daniel prosser
Subject printing (to screen) an ANSI array
> The way I get around this without turning directvideo off(False) is:
> Assign(OutPut,'') ;
> Rewrite(OutPut) ;
> Seems to work for me. Just include it at the beginning of your
> program.
dp> Nah I prefer just directvideo := false; much neater, your way would
dp> probably be more portable, but when using pascal portability isn't
dp> really an issue.
Trouble is, setting DirectVideo to false will not achieve the desired result.
In order to permit redirection and ansi code interpretation, screen writes
MUST be routed through DOS. DirectVideo := false does not do that, it merely
routes writes through the BIOS and hence will not work.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/06 22:07:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 14:08:06
From Trevor Carlsen
To geoff watts
Subject virus
JB> Thing I think is terribly fascinating is why haven't
JB> someone come up with a practical usage for the viruses
JB> yet..
..
gw> 6) Talking about them gets you kicked out of the echo :-)
No it won't... talking about them in terms of how to create, possible methods
to use and/or distribute them will, or outside the scope of this conference,
which is the Pascal language, will.
Generally speaking the subject is better left alone because as soon as it
is raised some idiot has to join the thread in a irresponsible way. Therefore
please drop it and don't resurrect it.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/06 22:07:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-06-92 08:23:44
From Dj Murdoch
To Robert Johnston
Subject Re: Turbo .EXE
RJ> Ok... Question... Sometimes, when I type out OVR files or EXE files (a
RJ> good example is TYPE TURBO.HLP ... I went in and hex viewied it with
RJ> norton utils and saw at the beginning
RJ> TURBO PASCAL HELP FILE. > ( > is the EOF marker to end TYPE )
RJ> how would i compile the source to make the first few bytes BE that text.
RJ> Thanks!
You can't make the first two bytes of an .EXE anything but MZ, or it won't
load. However, you could probably patch an .EXE so that it had your label
after the header, with a bunch of backspaces first to cover up whatever junk
you didn't want showing. TP can't produce an .EXE like that, though. If
you want to see where to put your message, take a look at any .EXE produced
by PKLITE - they stick a copyright notice in near the beginning. They don't
bother with the backspaces or the ^Z, though.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/05/07 08:05:45
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-07-92 01:18:20
From Trevor Carlsen
To Max Maischein
Subject 16550 chip
MM> DDJ April 1991 , I think.
MM> Jeff Duntemans column. But I'm not sure. He talked about UARTs,
MM> and their bugs. In DDJ March or April 1992, there was a readers note
MM> about it.
Thanks... I discovered that the information I needed was already available
to me in TPAsync.
MM> PS: Got my NetMail ?
No...try again. (My old machine went down for the count on April 23 and I
lost a couple of days of unread mail.)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-07-92 01:30:58
From Trevor Carlsen
To Dj Murdoch
Subject Standard I/O in TP?
DM> Does anyone have a copy or know where I could find one? If not, does
DM> anyone know of a way to contact Charles?
No to both questions. When CF originally went AWOL from the echo and someone
reported that he had suffered a catastrophic HD crash and had no funds for
a new one, I repeatedly tried to call his last known telephone number -
203 281 1438, as I wanted to get him back into the echo action quickly. I
have been unable to make contact at all and I have no address.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-07-92 17:29:00
From Trevor Carlsen
To Dj Murdoch
Subject Re: A Virtuous Pascal ...
DM> Their ideal language would be a faithful implementation of standard
DM> Pascal, without a lot of language extensions to confuse students. I
DM> think they'd prefer no modules at all, since standard Pascal doesn't
DM> have them.
DM> I've never taught programming, but I sure wouldn't want to be a
DM> student in a course as these people describe it. Standard Pascal is,
DM> in my opinion, a far inferior language to Turbo Pascal. (At least one
DM> of the academics I was talking to agreed with this, but didn't see
DM> that a first programming course should teach a useful language.)
If you think about it, that is probably reasonable thinking.
As a teaching aid, Standard (Wirth) Pascal would be superb. Anybody able to
produce useful work with it would easily move on and adapt to the real world,
whether it be using TP, C or any other modern HLL and GPP would have been
learnt and (hopefully) understood.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 01:07:21
From Trevor Carlsen
To David G. Edwards
Subject Re: Procedures...
DG> I was badly burned one time when I added some features to someone
DG> else's code, but overlooked the fact that he had hidden a couple of
DG> "halts" in some units. The code I added needed a few lines of
DG> initialization and a few lines of cleanup. If he had coded one entry
DG> and one exit, I wouldn't have wasted about 2 hours transferring a huge
DG> file over a phone line only to have the transfer fail because the
DG> cleanup code never executed. Instead of adding cleanup code every
DG> where there was a halt, I recoded the program...
The problem is solved if you use exit procedures correctly. That not only
ensures that the cleanup code is execute, regardless of where the halt or
exit is, it also ensures that it is executed in the event of a run-time error
causing a program termination.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 15:55:49
From Trevor Carlsen
To Damian Slee
Subject Clearing keyboard buffer
DS> A simple problem I'm sure, but does anyone know how to clear the
DS> keyboard buffer in pascal?
If you are using TP6 and have the extended syntax compiler directive set {$X+}
then and are using the crt unit -
procedure ClearKbdBuffer;
begin
while Keypressed do ReadKey;
end;
or if you don't have extended syntax then
procedure ClearKbdBuffer;
begin
while Keypressed do while ReadKey = #0 do;
end;
or if you do not wish to use the crt unit -
procedure ClearKbdBuffer;
var
head : byte absolute $40:$1a;
tail : byte absolute $40:$1c;
begin
asm cli end;
tail := head;
asm sti end;
end;
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 17:35:06
From Trevor Carlsen
To Andrew Krywaniuk
Subject 1/4 Keyboard input unit
AK> When I set a variable as an integer, and the person using my program
AK> is kind of stupid -(I ask: 'How many years old are you?', and they
AK> type: 'sixteen')- how can I avoid the inevitable break in the program,
AK> and replace it with my own 'please enter that on the numeric keypad,
AK> lesserlife' type message? It must be possible because those commercial
AK> programs written in pascal don't abort just because someone can't
AK> answer a simple question.
Instead of using readln as your input method, you need to write an input routine
that gets input a keypress at a time. This allows you to do a lot of error
checking etc...
Here is a unit that I posted some months back that has been modified still
further. It contains the procedures ReadStr, ReadInteger and ReadReal that
will do what you want. It also contains quite a few other useful things.
{$IFDEF Ver60}
{$A+,B-,D-,E+,F-,I-,L-,N+,O-,R-,S-,V-,X+}
{$ELSE}
{$A+,B-,D-,E+,F-,I-,L-,N+,O-,R-,S-,V-}
{$ENDIF}
unit keyinput;
{ Author Trevor J Carlsen - released into the public domain 1991 }
{ PO Box 568 }
{ Port Hedland }
{ Western Australia 6721 }
{ Voice +61 91 73 2026 Data +61 91 73 2569 }
{ FidoNet 3:690/644 }
{ This unit is designed to permit controlled input into a pre-determined }
{ field size. It also provides some handy associated procedures and }
{ functions and constants. }
interface
uses crt;
const
F1 = $3b00; ShF1 = $5400; CtrlF1 = $5e00; AltF1 = $6800;
F2 = $3c00; ShF2 = $5500; CtrlF2 = $5f00; AltF2 = $6900;
F3 = $3d00; ShF3 = $5600; CtrlF3 = $6000; AltF3 = $6a00;
F4 = $3e00; ShF4 = $5700; CtrlF4 = $6100; AltF4 = $6b00;
F5 = $3f00; ShF5 = $5800; CtrlF5 = $6200; AltF5 = $6c00;
F6 = $4000; ShF6 = $5900; CtrlF6 = $6300; AltF6 = $6d00;
F7 = $4100; ShF7 = $5a00; CtrlF7 = $6400; AltF7 = $6e00;
F8 = $4200; ShF8 = $5b00; CtrlF8 = $6500; AltF8 = $6f00;
F9 = $4300; ShF9 = $5c00; CtrlF9 = $6600; AltF9 = $7000;
F10 = $4400; ShF10 = $5d00; CtrlF10 = $6700; AltF10 = $7100;
BackSpace = $0e08; CtrlBackSpace = $0e7f;
Tab = $0f09; Tab_left = $0f00;
Enter = $1c0d; CtrlEnter = $1c0a;
InsertKey = $5200; DeleteKey = $5300;
Home = $4700; CtrlHome = $7700;
Endkey = $4f00; CtrlEnd = $7500;
PageUp = $4900; CtrlPageUp = $8400;
PageDn = $5100; CtrlPageDown = $7600;
UpArrow = $4800; DownArrow = $5000;
LeftArrow = $4b00; CtrlLeftArrow = $7300;
RightArrow = $4d00; CtrlRightArrow= $7400;
Escape = $011b;
type
Toggles = (RightShift, LeftShift, Ctrl, Alt,
ScrollLock, NumLock, CapsLock, Insert);
shiftstatus = set of Toggles;
CursorState = (Off, On, Normal, Block);
ToggleType = Off..On;
InputType = (Numeric, AlphaNumeric);
const
InsertOn : boolean = false;
var
KbdStatus : shiftstatus absolute $40:$17;
ValidKeys: array[InputType] of set of char;
procedure Beep(freq,len: word);
function CursorStatus: CursorState;
procedure Cursor(Action: CursorState);
procedure NormalCursor;
procedure HiddenCursor;
procedure BlockCursor;
procedure ClearKbdBuffer;
function ReadStr(width : word;
prompt : string;
attr : byte;
s : string;
_Input : InputType) : string;
function ReadInteger(p: string; attr: byte; min,max: longint): longint;
function ReadReal(p: string; attr: byte; min,max: longint): real;
procedure SetLock(TKey: Toggles; state: ToggleType);
function LeftShiftPressed: boolean;
function RightShiftPressed: boolean;
function AltPressed: boolean;
function CtrlPressed: boolean;
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 17:35:35
From Trevor Carlsen
To Andrew Krywaniuk
Subject 2/4 Keyboard input unit
...continued
implementation
var
OriginalStatus : CursorState;
OldExitProc : pointer;
procedure Beep(freq,len : word);
{ Beeps the speaker for len thousandths of a second }
begin
Sound(freq);
delay(len);
NoSound;
end; { Beep }
function CursorStatus: CursorState;
var
bottom: byte absolute $40:$60;
top : byte absolute $40:$61;
x : shortint;
begin
x := bottom - top;
if x < 0 then
CursorStatus := Off
else if x = 1 then
CursorStatus := Normal
else if x > 1 then
CursorStatus := Block
else CursorStatus := On;
end; { CursorStatus }
procedure Cursor(Action : CursorState);
{ Turn the cursor on/off or make it a block}
procedure ChangeCursor(top,bottom : byte);
begin
asm
mov ah, $01
mov ch, top
mov cl, bottom
int $10
end;
end; { ChangeCursor}
begin
case action of
On : if LastMode = Mono then
ChangeCursor($0C,$0C)
else
ChangeCursor($06,$06);
Normal : if LastMode = Mono then
ChangeCursor($0B,$0C)
else
ChangeCursor($06,$07);
Off : ChangeCursor($20,$00);
Block : if LastMode = Mono then
ChangeCursor($02,$0C)
else
ChangeCursor($02,$07);
end; { case}
end; { ChangeCursor}
procedure NormalCursor;
begin
Cursor(On);
end; { NormalCursor }
procedure HiddenCursor;
begin
Cursor(Off);
end; { HiddenCursor }
procedure BlockCursor;
begin
Cursor(Block);
end; { BlockCursor }
procedure ClearKbdBuffer;
begin
{$IFDEF Ver60}
while Keypressed do ReadKey;
{$ELSE}
while KeyPressed do while ReadKey = #0 do;
{$ENDIF}
end;
function KeyWord : word; assembler;
{ Returns a word value where the msb is the scan code of a keypress }
{ and the lsb is the asciiz value of the key. }
asm
mov ax,0
int 16h
end; { KeyWord }
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 17:36:07
From Trevor Carlsen
To Andrew Krywaniuk
Subject 3/4 Keyboard input unit
function ReadStr(width : word;
prompt : string;
attr : byte;
s : string;
_Input : InputType) : string;
{ Editing keys are - }
{ DeleteKey - DeleteKeys character at the cursor. }
{ LeftArrow - Nondestructive move cursor to the left. }
{ RightArrow - Nondestructive move cursor to the right. }
{ End - Move cursor to end of input string. }
{ Home - Move cursor to start of input string. }
{ Backspace - DeleteKeys character to the left of cursor. }
{ escape - Aborts routine which then returns just an }
{ escape character - regardless of what }
{ characters were previously entered. }
{ return/enter - Leaves routine with string returned. }
{ Width = The width of the input field. Once input reaches the width }
{ required, no further characters are accepted. }
{ prompt= A prompt will be displayed in the current attribute. If no }
{ prompt is required pass a nul string. }
{ attr = The input field will be displayed in attr colour. }
{ s = s will be displayed in the input field and the cursor will }
{ be positioned at the end of the s string. }
{ Example: }
{ st := ReadStr(20,'Enter Name: ',LtGrayOnBlue,st); }
{ ( st MUST be initialised in the above example before the call. ) }
const
space = #32;
var
xpos, ypos,
stpos,OldAttr : byte;
len : byte absolute s;
finished : boolean;
key : word;
ch : char absolute key;
procedure WriteField;
var x : byte;
begin
GotoXY(xpos,ypos);
for x := 1 to width do
write(space);
GotoXY(xpos,ypos);
end; { WriteField }
procedure DeleteChar;
begin
Delete(s,stpos,1);
s := s + space;
gotoXY(xpos,ypos);
write(s);
dec(len);
end; { DeleteChar }
procedure AddChar;
{ Checks that it is valid to insert or add a character to input str }
begin
if InsertOn then begin
if (len < width) then begin
move(s[stpos],s[succ(stpos)],width-pred(stpos));
inc(len);
s[stpos] := ch;
inc(stpos);
end
else beep(450,15);
end else begin
if stpos <= width then begin
s[stpos] := ch;
if stpos > len then
inc(len);
inc(stpos);
end else beep(450,15);
end;
end; { AddChar }
begin
finished := false;
OldAttr := TextAttr;
write(prompt);
TextAttr := attr;
xpos := WhereX;
ypos := WhereY;
WriteField;
stpos := succ(len);
repeat
GotoXY(xpos,ypos);
write(s);
GotoXY(xpos + pred(stpos),ypos);
if InsertOn then
Cursor(Block)
else
Cursor(Normal);
key := KeyWord;
case key of
InsertKey : InsertOn := not InsertOn;
DeleteKey : if (len > 0) and (stpos > 0) then
DeleteChar;
Enter : begin
ReadStr := s;
finished := true;
end;
BackSpace : if stpos > 1 then begin
dec(stpos);
DeleteChar;
end
else beep(450,15);
Escape : begin
finished := true;
ReadStr := ch;
WriteField;
len := 0;
end;
LeftArrow : if stpos > 1 then dec(stpos);
RightArrow : if stpos <= len then inc(stpos);
Home : stpos := 1;
EndKey : stpos := succ(len);
else
if char(lo(key)) in ValidKeys[_Input] then
AddChar
else beep(450,15);
end; { case key of }
until finished;
TextAttr := OldAttr;
writeln;
end; { ReadStr }
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 17:36:39
From Trevor Carlsen
To Andrew Krywaniuk
Subject 4/4 Keyboard input unit
function ReadInteger(p: string; attr: byte; min,max: longint): longint;
{ Prompts for input and converts that input to a longint. If number }
{ entered is less than min or greater than max, will report an error }
{ and request re-entry of the data. }
{ Example: }
{ long := ReadInteger('Enter number between 10 and 100: ', }
{ WhiteOnBlue,10,100); }
var
temp : longint;
code : integer;
finished : boolean;
st : string;
begin
if min >= 0 then
ValidKeys[Numeric] := ['0'..'9']
else
ValidKeys[Numeric] := ['0'..'9','-'];
repeat
st := ReadStr(11,p,attr,'',Numeric);
val(st,temp,code);
finished := (code = 0) and (temp >= min) and (temp <= max);
if not finished then
writeln('Error - redo')
else
ReadInteger := temp;
until finished;
end; { ReadInteger }
function ReadReal(p: string; attr: byte; min,max: longint): real;
{ Prompts for input and converts that input to a real. If number }
{ entered is less than min or greater than max, will report an error }
{ and request re-entry of the data. }
{ Example: }
{ R := ReadReal('Enter number between 10 and 100: ', }
{ WhiteOnBlue,10,100); }
var
temp : real;
code : integer;
finished : boolean;
st : string;
begin
if min >= 0 then
ValidKeys[Numeric] := ['0'..'9','.']
else
ValidKeys[Numeric] := ['0'..'9','-','.'];
repeat
st := ReadStr(11,p,attr,'',Numeric);
val(st,temp,code);
finished := (code = 0) and (temp >= min) and (temp <= max);
if not finished then
writeln('Error - redo')
else
ReadReal := temp;
until finished;
end; { ReadReal }
procedure SetLock(TKey: Toggles; state: ToggleType);
begin
case TKey of
CapsLock : if state = On then
KbdStatus := KbdStatus + [CapsLock]
else
KbdStatus := KbdStatus - [CapsLock];
NumLock : if state = On then
KbdStatus := KbdStatus + [NumLock]
else
KbdStatus := KbdStatus - [NumLock];
ScrollLock: if state = On then
KbdStatus := KbdStatus + [ScrollLock]
else
KbdStatus := KbdStatus - [ScrollLock];
end; { case }
end;
function LeftShiftPressed: boolean;
begin
LeftShiftPressed := LeftShift in KbdStatus;
end;
function RightShiftPressed: boolean;
begin
RightShiftPressed := RightShift in KbdStatus;
end;
function AltPressed: boolean;
begin
AltPressed := Alt in KbdStatus;
end;
function CtrlPressed: boolean;
begin
CtrlPressed := Ctrl in KbdStatus;
end;
procedure KbdExitProc; far;
begin
ExitProc := OldExitProc;
Cursor(OriginalStatus);
end; { KbdExitProc }
begin
ValidKeys[AlphaNumeric] := [#0..#255];
{ Set up an exit procedure to ensure that the cursor is restored }
OldExitProc := ExitProc;
OriginalStatus := CursorStatus;
end.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-08-92 19:48:00
From Trevor Carlsen
To Vince Laurent
Subject Setting the CAPS lock on.
VL> I am trying to write a program that will toggle the CAPS key on. The
VL> reason I am doing this is because our new mainframe works ONLY WITH
VL> UPPERCASE LETTERS and I am growing old/tired of answering calls that
VL> end with the reply 'Is your CAPS lock on?'.
See the Keyinput unit posted today for a procedure that will do this for you.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/08 19:35:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-09-92 04:53:16
From Trevor Carlsen
To Stephane Michaud
Subject Procedures
SM> I'm writing a large program and I need to call lots of
SM> procedures. As soon as one boolean var changes to false, i
SM> need to close them all except the main procedure. Is
SM> they're a better way to do this in Turbo Pascal 6.0 then
SM> using the exit (I hate that word) command?
Firstly, there are no such things as commands in Pascal. There are functions,
procedures, statements, declarations and data. The exit procedure is also
of little use to you in the above context as all it does is cause an immediate
departure from the current procedure.
Here is an unit that may help but I advocate caution in its use. Normally
a need for such practice would indicate poor design and/or understanding of
good programming practices.
unit LongJump;
{ This unit permits a long jump from deeply nested procedures/functions back }
{ to a predetermined starting point. }
{ Whilst the purists may shudder at such a practice there are times when such}
{ an ability can be exceedingly useful. An example of such a time is in a }
{ BBS program when the carrier may be lost unexpectedly whilst a user is on }
{ line and the requirement is to "back out" to the initialisation reoutines }
{ at the start of the program. }
{ To use the facility, it is required that a call be made to the SetJump }
{ function at the point to where you wish the execution to resume after a }
{ long jump. When the time comes to return to that point call FarJump. }
{ If you are an inexperienced programmer, I do not recommend that this unit }
{ be used for other than experimentation. Usually there are better ways to }
{ achieve what you want to do by proper planning and structuring. It is }
{ rare to find a well written program that will need such and ability. }
interface
const
normal = -1; { return was not from a LongJump call }
type
jumptype = record { the data need for a return jump }
bp,sp,cs,ip : word;
end;
function SetJump(var JumpData : jumptype): integer;
procedure FarJump(JumpData : jumptype; IDInfo : integer);
implementation
type
WordPtr = ^word;
function SetJump(var JumpData : jumptype): integer;
begin { store the return address (the old bp register) }
JumpData.bp := WordPtr(ptr(SSeg,SPtr+2))^;
JumpData.ip := WordPtr(ptr(SSeg,SPtr+4))^;
JumpData.cs := WordPtr(ptr(SSeg,SPtr+6))^;
JumpData.SP := SPtr;
SetJump := normal; { show that this is not a FarJump call }
end; { SetJump }
procedure FarJump(JumpData : jumptype; IDInfo : integer );
begin
{ change the return address of the calling routine of the stack so that }
{ a return can be made to the caller of SetJump }
{ Use IDInfo as an identifier of the routine the jump occurred from }
with JumpData do begin
WordPtr(ptr(SSeg,sp))^ := bp;
WordPtr(ptr(SSeg,sp+2))^ := ip;
WordPtr(ptr(SSeg,sp+4))^ := cs;
end; { with }
inline($8b/$46/$06); { mov ax,[bp+6] }
inline($8b/$ae/$fa/$ff); { mov bp,[bp-6] }
end; { FarJump }
end. { Unit LongJump }
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/09 17:14:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-09-92 04:41:22
From Trevor Carlsen
To John Bean
Subject Stacker, SpeedStor, DoubleDisk
JB> The problem I am having is with the DiskFree function of turbo pascal.
JB> * Origin: The Buffer Board (1:152/2.0)
JB> * Origin: P A S C A L A L L E Y (1:343/52)
JB> * Origin: Mountain Retreat * Felton Ca * 408-335-4595 (1:216/506)
John I cannot help you with your problem. However, I want to clear up any
misunderstanding you may have about echomail.
Any message posted on a BBS in an echomail conference, is automatically "echoed"
to all other BBSs who take that conference. In the case of the Pascal echo
this means that your message is seen by every reader of the Pascal echo at
hundreds of BBSs all over the world.
Your posting of virtually identical messages requesting help on the three
boards above is therefore "overkill". :-) Just the one message should be
sufficient to get your plea for help to many BBSs worldwide.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/09 17:14:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-09-92 15:22:18
From Trevor Carlsen
To Damian Slee
Subject TSR Clock
DS> I'm trying to write a TSR clock, though whenever Dos call made while
DS> this is active, will cause the computer to lock up. Any improvements
DS> to the following would be appreciated.
You are making DOS calls from within your interrupt. This is a no-no as DOS
is not re-entrant.
DS> Procedure ResidentClock; Interrupt;
DS> Var
DS> Hour,Minute,Sec,Sec100:Word;
DS> OldX,OldY:Byte;
DS> Begin
DS> If Ticks=18 Then
DS> Begin
DS> GetTime(Hour,Minute,Sec,Sec100); <-------- Uses DOS
DS> OldX:=WhereX; <-------- Uses DOS
DS> OldY:=WhereY; <-------- Uses DOS
DS> GotoXY(70,1); <-------- Uses DOS
DS> Write(Hour:2,':',Minute:2,':',Sec:2); <-------- Uses DOS
DS> GotoXY(OldX,OldY); <-------- Uses DOS
DS> Ticks:=0;
DS> End; {End 18 ticks}
DS> Ticks:=Ticks+1;
DS> TimerIntVec;
DS> End;
DS> {$F-}
Try the following -
{$A+,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}
{$M 1024,0,0}
uses dos,
clock; { My clock ISR unit in next message. }
const
IDStr : string[13] = 'TeeCee''s Clock';
var
p : pointer;
begin
GetIntVec($66,p); { Int 66h is reserved for user defined interrupts }
if string(p^) = IDStr then begin
writeln('TeeCee''s clock is already installed - you must be blind!');
halt;
end
else begin
writeln('TeeCee''s clock is now installed for demo purposes only');
SetIntVec($66,@IDStr); { IDStr is obviously not an interrupt! }
{ What we are actually doing is storing a pointer to the IDStr }
{ in the vector table - much like the way the Video font addresses }
{ are stored. }
SwapVectors;
Keep(0);
end;
end.
(See the next message for the unit Clock. )
Now that is definitely for demonstration purposes only! It will work but
has several serious shortcomings!
Firstly, it hooks the user defined interrupt $66 to allow any subsequent executi
ns to determine if the program is already installed. It does this without
making any checks as to whether or not something else already "owns" this
vector. Not very smart!
Secondly, it provides no means to uninstall itself. Mmmmm... :-(
Thirdly, graphics mode will cause problems. Again - not terribly smart!
Finally, TSRs are not for the faint-of-heart or beginner. They are an extraordin
rily complex and difficult part of DOS programming and if you are serious
about getting into TSRs then get as many good books as you can find that authori
ively discuss the subject. Buying a good commercial toolbox, such as Turbo
Power's "TSRs Made Easy" is another smart move, as studying how the masters
do it is one of the best ways to learn.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/09 17:14:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 05-09-92 07:23:27
From Trevor Carlsen
To Damian Slee
Subject TSR Clock
unit Clock;
{
Author: Trevor J Carlsen
Purpose: Demonstrate a simple "on screen" clock.
This demo unit works by "hooking" the timer interrupt ($1c). This
interrupt is called by the hardware interrupt ($08) approximately 18.2
times every second and normally consists of a simple return instruction
unless some other application has already hooked it.
Because the routine is called roughly 18 times every second it is
important that any processing it contains is optimised as much as
possible. Obviously the best way to do this is by assembly language but
in this demo I have used almost pure Turbo Pascal and have set up a
counter variable and any processing is only done every 6 calls. This is
more than sufficient and minimises processing. The routine is by no
means perfect - there will be a minor irregularity for the final 10
seconds of each day and for about half a second each hour. Better this
than to waste valuable processing time in the interrupt by coding it
out.
Because DOS is not re-entrant it is also important that the routine make
no calls to any procedure or function that makes use of dos for its
operation. Thus no writeln, write can be used. To display the time on
screen an array is addressed directly to screen memory. Any changes in
this array are thus reflected on the screen. The downside to this is
that on older CGAs this would cause a "snow" effect and code would be
needed to eliminate this. It also means that the TP procedure GetTime
cannot be used. So the time is calculated from the value stored at the
clock tick counter location.
To display an on-screen clock all that is required is for a programmer
to include this unit in the uses declaration of the program.}
interface
const
DisplayClock : boolean = true;
implementation
{ Everything is private to this unit }
uses dos;
const
line = 0; { Change as required for position of display on screen }
column = 0; { Top left corner is 0,0 }
ScreenPos = (line * 160) + (column * 2);
Colour = $1f; { White on Blue }
ZeroChar = Colour shl 8 + ord('0');
Colon = Colour shl 8 + ord(':');
type
timestr = array[0..7] of word;
timeptr = ^timestr;
var
time : timeptr;
OldInt1c : pointer;
ExitSave : pointer;
{$F+}
procedure Int1cISR; interrupt;
{ This will be called every clock tick by hardware interrupt $08 }
const
count : integer = 0; { To keep track of our calls }
var
hr : word absolute $40:$6e;
ticks : word absolute $40:$6c;
{ This location keeps the number of clock ticks since 00:00}
min,
sec : byte;
seconds : word;
begin
asm cli end;
if DisplayClock then begin
inc(count);
if count = 6 then { ticks to update the display } begin
count := 0; { equality check and assignment faster than mod }
seconds := ticks * longint(10) div 182; { speed = no reals }
min := (seconds div 60) mod 60;
sec := seconds mod 60;
{ The following statements are what actually display the on-screen time}
time^[0] := ZeroChar + (hr div 10); { first char of hours }
time^[1] := ZeroChar + (hr mod 10); { second char of hours }
time^[2] := Colon;
time^[3] := ZeroChar + (min div 10); { first char of minutes }
time^[4] := ZeroChar + (min mod 10); { second char of minutes }
time^[5] := Colon;
time^[6] := ZeroChar + (sec div 10); { first char of seconds }
time^[7] := ZeroChar + (sec mod 10); { second char of seconds }
end; { if count = 6 }
end; { if DisplayClock }
asm
sti
pushf { push flags to set up for IRET }
call OldInt1c; { Call old ISR entry point }
end;
end; { Int1cISR }
procedure ClockExitProc;
{ This procedure is VERY important as you have hooked the timer interrupt }
{ and therefore if this is omitted when the unit is terminated your }
{ system will crash in an unpredictable and possibly damaging way. }
begin
ExitProc := ExitSave;
SetIntVec($1c,OldInt1c); { This "unhooks" the timer vector }
end;
{$F-}
procedure Initialise;
var
mode : byte absolute $40:$49;
begin
if mode = 7 then { must be a mono adaptor }
time := ptr($b000,ScreenPos)
else { colour adaptor of some kind }
time := ptr($b800,ScreenPos);
GetIntVec($1c,OldInt1c); { Get old timer vector and save it }
ExitSave := ExitProc; { Save old exit procedure }
ExitProc := @ClockExitProc; { Setup a new exit procedure }
SetIntVec($1c,@Int1cISR); { Hook the timer vector to the new procedure }
end; { Initialise }
begin
Initialise;
end.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss v1.00b on 92/05/09 17:14:42